//
//  NearByTableViewCell.m
//  VTravel
//
//  Created by lanouhn on 16/8/2.
//  Copyright © 2016年 xiaoYu. All rights reserved.
//

#import "NearByTableViewCell.h"


@implementation NearByTableViewCell

/** 重写属性的setter方法,在使用点语法进行调用的时候会走这个方法 */
- (void)setNearByModelArray:(NSMutableArray *)nearByModelArray{
    for (int i = 1100; i < 1104; i++) {
        RootScrollViewModel *model = nearByModelArray[i - 1100];
        UIButton *button = (UIButton *)[self viewWithTag:i];
        [button setTitle:model.title forState:(UIControlStateNormal)];
        [button sd_setBackgroundImageWithURL:[NSURL URLWithString:model.src] forState:UIControlStateNormal];
        [button addTarget:self action:@selector(ClickButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

#pragma mark - button点击事件
- (void)ClickButtonAction:(UIButton *)sender{
    if (self.ClickedSceneryBtnBlock) {
        self.ClickedSceneryBtnBlock(sender.titleLabel.text);
    }
}

#pragma mark - 跳转到管家页面的事件
- (IBAction)PushToStewardAction:(UIButton *)sender {
    if (self.ClickedStewardBlock) {
        self.ClickedStewardBlock();
    }
}



@end
